using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;

namespace GameFramework.Managers
{
    /// <summary>
    /// The font manager.
    /// </summary>
    public static class FontManager
    {
        /// <summary>
        /// Initializes static members of the <see cref="FontManager"/> class.
        /// </summary>
        static FontManager()
        {
            Fonts = new Dictionary<string, SpriteFont>();
        }

        /// <summary>
        /// Gets or sets the fonts dictionary.
        /// </summary>
        public static Dictionary<string, SpriteFont> Fonts { get; set; }

        /// <summary>
        /// Load a font.
        /// </summary>
        /// <param name="assetName">The asset name.</param>
        /// <param name="fontName">The font name.</param>
        public static void LoadFont(string assetName, string fontName)
        {
            Fonts[fontName] = Global.Game.Content.Load<SpriteFont>(assetName);
        }

        /// <summary>
        /// Load a font. The asset name will be "fonts/" followed by the font name.
        /// </summary>
        /// <param name="fontName">The font name.</param>
        public static void LoadFont(string fontName)
        {
            Fonts[fontName] = Global.Game.Content.Load<SpriteFont>("fonts/" + fontName);
        }
    }
}
